package softwarehouse;


public class GenerateProduct {
	private String c[];
	private String dir;
	private String cpy;
	private String finaldir;
        
        /**
         * 
         * @param components the components requested by the programmer
         */
	public GenerateProduct(String components[],String output,String artifacts) {

                //the directory where the linked software artefacts will be put before been sent
		dir = artifacts;
                //location of the compiles software artefacts
		cpy = "/Users/matt/linking1/sh/";
                //"Sending" the files in dir
                finaldir = output;
                
                c = components;
		//Link together all the software artefacts requested
		createProduct();	
	}
	/**
         * Link together all the software artefacts requested
         * 
         */
	public void createProduct() {
		//GenLic g = new GenLic("67");
		JavaRunCommand comm = new JavaRunCommand();
		
		String file = new String();
		String temp = "ld -r -o " +finaldir+ "SH " + dir+"T ";
				
		for(int i = 0 ; i<c.length; i++) {
                    temp = temp + dir+c[i] + " ";   
                }               
		comm.run(temp);
		//comm.run("cp "+ dir+ "SH " + finaldir );	
        }
}
